package com.zhongfl.crm.model.boss;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhongfl.crm.annotation.FieldMeta;
import com.zhongfl.crm.enums.boss.WorkOrderTypeCode;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * @author 犬冢牙 2018/9/28 19:39
 */
@Data
public class OrderBattleLog {

    /**
     * 自增id
     */
    private Long id;

    /**
     * 交付订单编号
     */
    private String orderNo;

    /**
     * 战报类型
     */
    private WorkOrderTypeCode battleType;

    /**
     * 战报类型名称
     */
    private String battleTypeName;

    public String getBattleTypeName() {
        if (Objects.isNull(battleType)) {
            return StringUtils.EMPTY;
        }
        if (WorkOrderTypeCode.LOAN_APPROVE.equals(this.battleType)) {
            return "授信战报";
        }
        if (WorkOrderTypeCode.LOANED.equals(this.battleType)) {
            return "放款战报";
        }
        return StringUtils.EMPTY;
    }

    /**
     * 客户姓名
     */
    @FieldMeta(name = "客户姓名")
    private String battleUserName;

    /**
     * 商务经理
     */
    @FieldMeta(name = "商务经理")
    private String businessManager;

    /**
     * 交付经理
     */
    @FieldMeta(name = "交付经理")
    private String deliverManager;

    /**
     * 战报金额
     */
    @FieldMeta(name = "金额")
    private BigDecimal loanAmount;

    /**
     * 战报日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @FieldMeta(name = "日期")
    private Date battleDay;

    /**
     * 录入人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    private Date createdTime;


    private String deliverOrderNo;

}
